import { IArticleComment, ICommentList } from '@/api/comment/type';
import { http } from '@/core/http';

/**
 * 评论
 * @param data
 */
export const postArticleComment = (data: IArticleComment.ICommentReq) => {
  return http.post({
    url: 'article/comment',
    data,
    cache: false,
    isLoading: false,
    isShowSuccessText: true
  });
};

/**
 * 评论列表
 * @param params
 */
export const getCommentList = (params?: ICommentList.IReq) => {
  return http.get<ICommentList.IResponse>({
    url: 'article/comment/list',
    params,
    cache: false,
    isLoading: false
  });
};
/**
 * 删除评论
 * @param params
 */
export const deleteCommentItem = (params: {
    commentId?: number;
    subCommentId?: number;
}) => {
  return http.delete({
    url: 'article/comment/delete',
    params,
    cache: false,
    isLoading: false,
    isShowSuccessText: true
  });
};
